﻿using TrackSystem.IO.Logics;
using TrackSystem.IO.Loops;
using TrackSystem.IO.Models;
using TrackSystem.IO.Sensors;

namespace TrackSystem.UI.Server.Features;

/// <summary>
/// 部件选择类型
/// </summary>
public enum PartEnum
{
    SENSOR = 0,
    LOGIC,
    LOOP,
}

/// <summary>
/// 当前选择类型及名称
/// </summary>
public class PartSelect
{
    public PartEnum CurrentPart { get; set; }
    public string?  CurrentName { get; set; }
    public SensorUnit? Sensor { get; set; }
    public LogicItem? Logic { get; set; }
    public LoopItem? Loop { get; set; }
    public bool IsExist { get; set; }

    /// <summary>
    /// 构造函数
    /// </summary>
    public PartSelect()
    {
        CurrentPart = PartEnum.SENSOR;
        IsExist = false;
        CurrentName = null;
        Sensor = null;
        Logic = null;
        Loop = null;
    }
}
